package com.wechat.page.contact.misc;

import com.swak.fx.support.ui.UI;
import com.swak.fx.support.ui.UIIcon;
import com.swak.fx.support.ui.UILabel;

import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;

/**
 * 管理按钮
 * 
 * @author 618lf
 */
public class ManageBtn extends GridPane {

	private final String[] STYLECLASS = { "contact__mbtn" };

	private UIIcon icon;
	private UILabel text;

	public ManageBtn() {
		this.getStyleClass().addAll(STYLECLASS);
		this.icon = new UIIcon().Icon(UI.Icons.USERS);
		this.text = new UILabel("通讯录管理");
		this.getChildren().addAll(this.icon, this.text);
		GridPane.setMargin(this.icon, new Insets(0, 5, 0, 0));
		GridPane.setMargin(this.text, new Insets(0, 0, 0, 5));
		GridPane.setConstraints(this.icon, 0, 0);
		GridPane.setConstraints(this.text, 1, 0);
		GridPane.setHgrow(this.icon, Priority.ALWAYS);
		GridPane.setVgrow(this.icon, Priority.ALWAYS);
		GridPane.setHalignment(this.icon, HPos.RIGHT);
		GridPane.setValignment(this.icon, VPos.CENTER);
		GridPane.setHgrow(this.text, Priority.ALWAYS);
		GridPane.setVgrow(this.text, Priority.ALWAYS);
		GridPane.setHalignment(this.text, HPos.LEFT);
		GridPane.setValignment(this.text, VPos.CENTER);
	}
}
